<template>
	<view class="camera-wrap">
		<canvas
			id="gestureCanvas"
			type="2d"
			canvas-id="gestureCanvas"
			style="width: 750rpx; height: 750rpx; background: #eee;"
			@touchstart="onTouchStart"
			@touchmove="onTouchMove"
			@touchend="onTouchEnd"
		/>
	</view>

</template>

<script>
	import Gesture from '@/utils/gesture.js';

	let gestureInstance = null;
	export default {
		components: {
		},
		data() {
			return {
			}
		},
		onLoad() {
		},
		mounted(){
			gestureInstance = new Gesture(this, {
				canvasId: 'gestureCanvas',
			});
		},
		methods: {
			onTouchStart(e) {
				if (gestureInstance) gestureInstance.onTouchStart(e);
			},
			onTouchMove(e) {
				if (gestureInstance) gestureInstance.onTouchMove(e);
			},
			onTouchEnd(e) {
				if (gestureInstance) gestureInstance.onTouchEnd(e);
			}
		}
	}
</script>

<style lang="scss" scoped>
	
</style>
